<template>
  <el-row>
    <el-col :span="24">
      <div class="grid-content bg-purple">
        <FormPanel ref="formPanel" :list="formList" :cols="1" :isSubmitBtn="false" />
      </div>
    </el-col>
    <el-col :span="24" style="margin-top:10px;">
      <div class="btn">
        <el-button size="small" icon="el-icon-folder-add" type="primary" class="btnStyle" @click="save">保存</el-button>
        <el-button size="small" icon="el-icon-refresh-left" type="primary" class="btnStyle" @click="saveReset">返回</el-button>
      </div>
    </el-col>
  </el-row>
</template>

<script>
// import { getOrderList } from '@/api/repair/repair/activitesManage';
// import AddActivity from './addActivity';
export default {
  name: 'fwhddr',
  components: {
    //  AddPjxm
  },
  data() {
    return {
      formList: this.createFormList()
    };
  },
  mounted() {
    // this.query()
  },
  methods: {
    validateFn(rule, value, callback) {
      if (value.length < rule.limit) {
        return callback(new Error(rule.message));
      }
      callback();
    },
    save() {
      this.$emit('closeFwhddr', false);
    },
    saveReset() {
      this.$emit('closeFwhddr', false);
    },
    createFormList() {
      return [
        {
          type: 'UPLOAD_FILE',
          label: '上传文件',
          fieldName: 'wayFiles',
          placeholder: '上传文件...',
          rules: [{ required: true, message: '请上传文件', trigger: 'change' }],
          initialValue: [],
          upload: {
            actionUrl: '/api/file/oss/upload',
            limit: 1,
            tipText: '只能上传pdf格式'
          }
        }
      ];
    }
  }
};
</script>

<style scoped lang="less">
.bg1 {
  border: 1px solid @borderColor;
  border-radius: @borderRadius;
  box-shadow: @boxShadow;
  padding: @modulePadding;
  padding-left: 0;
  padding-top: 15px;
  padding-bottom: 15px;
}
.bg2 {
  margin-top: 10px;
  margin-bottom: 10px;
}
.btn {
  text-align: center;
}
.btnStyle {
  margin-top: 10px;
}
</style>
